home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Subject: Re: Streams
- X-Nntp-Posting-Host: golden.ripco.com
- Message-ID: <DLnvnp.229@rci.ripco.com>
- Sender: usenet@rci.ripco.com (Net News Admin)
- Organization: Ripco Internet BBS Chicago
- Date: Wed, 24 Jan 1996 01:19:01 GMT
- X-Ident-Sender: mambuhl
-
- xenon@the-fix.sos.on.ca
- in <4e0lp3$lkf@nic.wat.hookup.net> writes:
-
- >HI, im having some trouble getting my program to write to streams...
- >ex:
-
- Since your program appears to have no errors, and compiles and runs
- just fine for me with bcc or gcc, I would suggest that you re-install
- the compiler, making sure that you skip no steps. Dot every i and cross
- every t.
-
-
- >#include <stdio.h>
-
- >int main(void)
- >{
- > FILE *stream;
- > int i = 100;
- > char c = 'C';
- > float f = 1.234;
-
- > /* open a file for update */
- > stream = fopen("DUMMY.FIL", "w+");
-
- > /* write some data to the file */
- > fprintf(stream, "%d %c %f", i, c, f);
-
- > /* close the file */
- > fclose(stream);
- > return 0;
- >}
-
-
- > This example taken out of the Borland Help library should work fine.
- >Yet, nothing is written to the file "dummy.fil". although the file is
- >created. I have tried running my comiler from Dos and Win95 to no
- >avail. My stream problem is no just centered around the disk file
- >streams, but also stdout, and stderr. Strangely though, my read() and
- >write() functions work just fine.
- >thankx
- >xenon@the-fix.sos.on.ca
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-